home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
utilwb
/
vark13.lha
/
Vark
/
Lottery
/
lottery.e
< prev
next >
Wrap
Text File
|
1994-12-10
|
1KB
|
39 lines
/* Lottery.e v1.1 (10/12/94) ©1994 Michael Askin */
MODULE 'DOS/DOS'
PROC main()
DEF r,ds : datestamp,i, array[50]:ARRAY OF LONG, j, pos
DEF numbers[7]:ARRAY OF LONG, n
/* Version String */
WriteF('\s\n','$VER: Lottery 1.1 (10.12.94) ©1994 Michael Askin'+6)
DateStamp(ds)
FOR i:=0 TO ds.tick DO Rnd(100)
/* Setup balls! The numbers in the array only need to be non-zero */
/* rather than individual numbers. */
FOR i:=1 TO 49
array[i]:=i
ENDFOR
/* Pick one at random, if picked already (array[x]=0) then try again */
/* and do it 6 times */
FOR i:=0 TO 5
WHILE array[(pos:=Rnd(48)+1)]=0
IF CtrlC()=TRUE THEN CleanUp(0)
ENDWHILE
/* Mark it as read */
array[pos]:=0
ENDFOR
/* Now read the numbers marked in numerical order */
WriteF('Your numbers are : ')
FOR i:=1 TO 49
IF array[i]=0 THEN WriteF('\d ',i)
ENDFOR
WriteF('\n')
ENDPROC